home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
SourceCode
/
daymisckit_proj
/
Examples
/
DAYString
/
output
< prev
next >
Wrap
Text File
|
1995-06-12
|
2KB
|
43 lines
string1 = "The first string.", length = 17.
string2 = "01234567890123456789", length = 20.
String1 + String2 = "The first string.01234567890123456789", length = 37.
String1 = "The first string.", length = 17.
string1!=string1: 0, string1!=string2: -1
left5 = 01234 right5 = 56789 mid5to10 = 567890 mid6len5 = 67890
Substrings from string1 and "first"...Left:"The " Right:"first string."
Extract parts from "don:*:23:21:Don Yacktman:/LocalLibrary/Users/don:/bin/csh" delimiting with ':':
Part #3 is "23"
Part #10 is "(null pointer)"
Return was nil.
First part is "don"
Last part is "/bin/csh"
Given: /Net/darth/Users/don/Projects/daymisckit_proj/daymisckit-1/DAYString.m
Path is: /Net/darth/Users/don/Projects/daymisckit_proj/daymisckit-1
Filename is: DAYString.m
Carl's string: " Hello, how are you? ", length = 25
Numwords: 4
3rd word: "are"
trimmed: "Hello, how are you?"
Numwords: 4
Reversed: "?uoy era woh ,olleH"
Reversed again: "Hello, how are you?"
ToUpper: "HELLO, HOW ARE YOU?"
ToLower: "hello, how are you?"
Inserting "Oh! " at 0: "Oh! hello, how are you?"
Char at 0: 'O'
ReplaceFrom 0to2 with "YOHO!": "YOHO! hello, how are you?"
spotOf 'o': 10
spotOf 'o' nocase: 1
rspotOf 'O': 3
rspotOf 'O' nocase: 22
10th rspotOf 'O': -1
replace "YOHO!" with "My!": "My! hello, how are you?"
String now is " Hello, I am fine today. Right? "
Squashed: "Hello, I am fine today. Right?"
endcmp "Right?": 0
endcasecmp "RIGHT?": 0
endcmp "RIGHT?": 1
endcasecmp n:3 "nacHT?": 0
replaceCharAt:0 with 'J': "Jello, I am fine today. Right?"
insertChar 'a' at 1: "Jaello, I am fine today. Right?"